import React, { memo } from 'react';
import { Table, Card, Radio } from 'antd';
// import numeral from 'numeral';
import styles from './Analysis.less';
// import { MiniArea } from '@/components/Charts';

const columns = [
  {
    title: '序号',
    dataIndex: 'index',
    key: 'index',
  },
  {
    title: '项目名称',
    dataIndex: 'name',
    key: 'name',
    render: text => <a href="/">{text}</a>,
  },
  {
    title: '当前环节',
    dataIndex: 'type',
    key: 'type',
  },
  {
    title: '任务事项',
    dataIndex: 'desc',
    key: 'desc',
  },
  {
    title: '发起人',
    dataIndex: 'user',
    key: 'user',
  },
];

const TopSearch = memo(({ loading, visitData2, searchData, salesType, handleChangeSalesType }) => (
  <Card
    loading={loading}
    className={styles.salesCard}
    bordered={false}
    title="业务流"
    extra={
      <div className={styles.salesCardExtra}>
        <div className={styles.salesTypeRadio}>
          <Radio.Group value={salesType} onChange={handleChangeSalesType}>
            <Radio.Button value="all">代办业务</Radio.Button>
            <Radio.Button value="online">代办审批</Radio.Button>
            <Radio.Button value="stores">会议审批</Radio.Button>
          </Radio.Group>
        </div>
      </div>
    }
    // style={{ marginTop: 24 }}
  >
    {/*<Row gutter={68}>
      <Col sm={12} xs={24} style={{ marginBottom: 24 }}>
        <MiniArea line height={45} data={visitData2} />
      </Col>
      <Col sm={12} xs={24} style={{ marginBottom: 24 }}>
        <MiniArea line height={45} data={visitData2} />
      </Col>
    </Row>*/}
    <Table
      rowKey={record => record.index}
      size="middle"
      columns={columns}
      dataSource={searchData}
      pagination={{
        style: { marginBottom: 0 },
        pageSize: 5,
      }}
    />
  </Card>
));

export default TopSearch;
